package org.casper.gc;

/**
 * 测试ParallelGC日志
 */
public class TesParallelGC {
	
	/**
	 * 默认执行：默认的JDK的垃圾收集器就是并行垃圾收集器
	 * 执行参数:-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps
	 */
	
	@SuppressWarnings("unused")
	public static void main(String[] args) {
		while(true){
			
			byte[] b1 = new byte[1024*1024*10];
			byte[] b2 = new byte[1024*1024*10];
			byte[] b3 = new byte[1024*1024*10];
			
			long maxMem = Runtime.getRuntime().maxMemory()/1024/1024;  
	        long freeMem = Runtime.getRuntime().freeMemory()/1024/1024;  
	        long usedMem = maxMem - freeMem;  
			System.out.println(usedMem);
		}
	}
}
